package com.ihr360.insurance.model.dto.benefits;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ihr360.commons.model.entity.NumberId;
import com.ihr360.insurance.model.dto.benefits.embeddable.CompanyPaymentConfig;
import com.ihr360.insurance.model.dto.benefits.embeddable.PersonPaymentConfig;
import com.ihr360.insurance.model.dto.benefits.embeddable.RemedialConfig;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.MappedSuperclass;
import java.util.Date;

@MappedSuperclass
public class AbstractBenefitConfig extends NumberId<Long> {

    private static final long serialVersionUID = 2273962046417730206L;

    /** 补缴配置 */
    @Embedded
    private RemedialConfig remedialConfig = new RemedialConfig();

    /** 企业缴纳配置 */
    @Embedded
    private CompanyPaymentConfig companyConfig = new CompanyPaymentConfig();

    /** 个人缴纳配置 */
    @Embedded
    private PersonPaymentConfig personConfig = new PersonPaymentConfig();

    /**
     * 生效年月
     */
    @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
    @Column(nullable = false)
    private Date effectiveOn;

    /**
     * 失效年月
     */
    @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
    private Date invalidOn;

    public RemedialConfig getRemedialConfig() {
        return remedialConfig;
    }

    public void setRemedialConfig(RemedialConfig remedialConfig) {
        this.remedialConfig = remedialConfig;
    }

    public CompanyPaymentConfig getCompanyConfig() {
        return companyConfig;
    }

    public void setCompanyConfig(CompanyPaymentConfig companyConfig) {
        this.companyConfig = companyConfig;
    }

    public PersonPaymentConfig getPersonConfig() {
        return personConfig;
    }

    public void setPersonConfig(PersonPaymentConfig personConfig) {
        this.personConfig = personConfig;
    }

    public Date getEffectiveOn() {
        return effectiveOn;
    }

    public void setEffectiveOn(Date effectiveOn) {
        this.effectiveOn = effectiveOn;
    }

    public Date getInvalidOn() {
        return invalidOn;
    }

    public void setInvalidOn(Date invalidOn) {
        this.invalidOn = invalidOn;
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    @Override
    public boolean equals(Object o) {
        return super.equals(o);
    }
}
